import {defineStore} from "pinia";

interface SettingState {
    collapse: boolean;
    dark: boolean
}

export const useSettingStore = defineStore("icesoft-setting", {
    persist: {
        enabled: true,
    },
    state() {
        const state: SettingState = {
            collapse: false,
            dark: false,
        };
        return state;
    },
    actions: {
        changeCollapse() {
            this.collapse = !this.collapse;
        },
        setTheme(dark: boolean) {
            this.dark = dark;
        }
    },
});
